package com.ds.common.org.expression.person;

import java.util.Stack;

import com.ds.common.expression.ParseException;
import com.ds.common.expression.function.Function;
import com.ds.org.OrgManager;
import com.ds.org.Person;
import com.ds.server.JDSClientService;
import com.ds.server.OrgManagerFactory;

/**
 * <p>Title: JDSORG组织机构中间件</p>
 * <p>Description: </p>
 * <p>Copyright: jds Copyright (c) 2003-2008</p>
 * <p>Company: www.justdos.net</p>
 * @author wenzhangli
 * @version 2.0
 */
public class GetAllPerson extends Function {
	public GetAllPerson() {
		numberOfParameters = 0;
	}

	public void run(Stack stack) throws ParseException
	{
		checkStack(stack); // check the stack

	}

	protected Person[] perform(JDSClientService client) throws ParseException {
		OrgManager orgManager = OrgManagerFactory.getOrgManager();
		return (Person[]) orgManager.getPersons().toArray(new Person[orgManager.getPersons().size()]);
 	}
}
